package DouDiZhu;

import java.util.ArrayList;
import java.util.Collection;
import java.util.*;

public class Test {
    public static void main(String[] args) {
        List<String> poker = new ArrayList<>();
        Collection<String> flowerColor = new ArrayList<>();
        Collection<String> number = new ArrayList<>();

        flowerColor.add("♥");
        flowerColor.add("♠");
        flowerColor.add("♣");
        flowerColor.add("♦");
//        System.out.println(flowerColor);
        number.add("1");number.add("2");number.add("3");number.add("4");
        number.add("5");number.add("6");number.add("7");number.add("8");
        number.add("9");number.add("10");number.add("J");number.add("Q");
        number.add("K");
//        System.out.println(number);

        for(String num : number){
            for (String color : flowerColor) {
                //System.out.println(color+number);
                //把组装好的牌存储到poker集合中
                poker.add(color+num);
            }
        }
        poker.add("大王");
        poker.add("小王");
//        System.out.println(poker);
        Collections.shuffle(poker);
//        System.out.println(poker);

        ArrayList<String> player1 = new ArrayList<String>();
        ArrayList<String> player2 = new ArrayList<String>();
        ArrayList<String> player3 = new ArrayList<String>();
        ArrayList<String> dipai = new ArrayList<String>();

        for (int i=0;i<54;i++){
            if (i >= 51){
                dipai.add(poker.get(i));
            }else if (i % 3 == 0){
                player1.add(poker.get(i));
            }else if (i % 3 == 1){
                player2.add(poker.get(i));
            }else {
                player3.add(poker.get(i));
            }
        }
        System.out.println("玩家一:"+player1);
        System.out.println("玩家二:"+player2);
        System.out.println("玩家三:"+player3);
        System.out.println("底牌:"+dipai);
    }
}
